.PHONY: init
# 初始化基礎環境
init:
	make -C app/evaluation init_simple

.PHONY: all
# 生成 proto 文件、配置文件、wire 文件
all:
	make -C app/evaluation all

.PHONY: evaluation
evaluation:
	cd app/evaluation && air -c .air.toml ./...

.PHONY: client
client:
	cd app/client && air -c .air.toml ./...

.PHONY: task
# air 熱加載 house_task 服務
task:
	cd app/task && air -c .air-task.toml ./...

.PHONY: model
# 生成 gen model 文件
model:
	make -C app/evaluation model

# 幫助信息
help:
	@echo ''
	@echo 'Usage:'
	@echo ' make [target]'
	@echo ''
	@echo 'Targets:'
	@awk '/^[a-zA-Z\-\_0-9]+:/ { \
	helpMessage = match(lastLine, /^# (.*)/); \
		if (helpMessage) { \
			helpCommand = substr($$1, 0, index($$1, ":")); \
			helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
			printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
		} \
	} \
	{ lastLine = $$0 }' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help